<?php

class Banners extends MX_Controller {

    function Banners() {
        parent::__construct();
		$this->load->model('lookupmodel');
		$this->load->model('helpermodel');
		//check is logged in
		$this->load->model('languagemodel');
		$this->load->model('projects/mdl_projectsmodel');
		$this->language = $this->languagemodel->is_language_using();
		$this->load->helper('MY_url_helper');
		$this->load->helper('text');
    }

    function index() {
        $data = "";


        $data['title'] = "HongKong Property, Property for Sale/Rent, HongKong Real Estate | Jones Lang LaSalle (HK) Residential";
        $data['description'] = "HongKong Property - Find HongKong real estate listings, property for sale/rent with Jone Lang LaSalle, HongKong's Leading Property Site.";
        $data['keywords'] = "HongKong property, HongKong real estate, property for sale, property for rent, property guru, HongKong property listings";

        $this->load->view('list_banners', $data);
    }

    function create() {
        $data = "";
        $this->load->view('create', $data);
    }

    function view($id = "") {
        $data = "";

        $data['title'] = "HongKong Property, Property for Sale/Rent, HongKong Real Estate | Jones Lang LaSalle (HK) Residential";
        $data['description'] = "HongKong Property - Find HongKong real estate listings, property for sale/rent with Jone Lang LaSalle, HongKong's Leading Property Site.";
        $data['keywords'] = "HongKong property, HongKong real estate, property for sale, property for rent, property guru, HongKong property listings";

        if ($id != "") {
            $this->load->view('view', $data);
        } else {
            redirect('pages');
        }
    }

    function is_logged_in() {
        $is_logged_in = $this->session->userdata('is_logged_in');
        if (!isset($is_logged_in) || $is_logged_in != true) {
            redirect('login/error', 'refresh');
            die();
            //$this->load->view('login_form');
        }
    }

}

